import session from 'koa-session'

const config = {
  key: 'koa:sess',
  maxAge: 86400000,
  overwrite: true,
  httpOnly: true,
  signed: true,
  rolling: false,
  renew: false
}

class SessionMiddleware{
  private app
  constructor(app){
    this.app = app
    this.register()
  }
  register(){
    this.app.keys = ['some secret hurr']
    this.app.use(session(config,this.app))
  }
}

export default SessionMiddleware
